package com.study.controller;

import com.study.dao.UserDao;
import com.study.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author peng.guo on 2018/2/9.
 */
@RestController
public class UserController {

  @Autowired
  private UserDao userDao;

  @GetMapping("/simple/{id}")
  public User findById(@PathVariable Long id){
    User user = userDao.findOne(id);

    return user;
  }

}
